load("@rules_rust//rust:defs.bzl", "rust_doc_test", "rust_library")
load("//bazel:canisters.bzl", "rust_canister")

package(default_visibility = ["//visibility:public"])

DEPENDENCIES = [
    # Keep sorted.
    "@crate_index//:candid",
    "@crate_index//:futures",
    "@crate_index//:ic-cdk",
    "@crate_index//:ic-management-canister-types",
    "@crate_index//:rand",
    "@crate_index//:rand_pcg",
    "@crate_index//:serde",
    "@crate_index//:serde_bytes",
]

MACRO_DEPENDENCIES = [
    # Keep sorted.
]

rust_library(
    name = "xnet_test",
    srcs = glob(["src/**"]),
    crate_name = "xnet_test",
    version = "0.9.0",
    deps = DEPENDENCIES,
)

rust_doc_test(
    name = "xnet_test_doc_test",
    crate = ":xnet_test",
)

rust_canister(
    name = "xnet-test-canister",
    srcs = ["src/main.rs"],
    proc_macro_deps = MACRO_DEPENDENCIES,
    service_file = ":xnet_test.did",
    deps = DEPENDENCIES + [":xnet_test"],
)
